<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Embroidermodder: extern/libembroidery/src/geometry/vector.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
  extensions: ["tex2jax.js", "TeX/AMSmath.js"],
  jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="logo_embroidermodder_2_0.png"/></td>
  <td id="projectalign">
   <div id="projectname">Embroidermodder<span id="projectnumber">&#160;2.0.0-alpha4</span>
   </div>
   <div id="projectbrief">A free and open source software for machine embroidery</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('vector_8c.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">vector.c File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;stdio.h&gt;</code><br />
<code>#include &lt;stdlib.h&gt;</code><br />
<code>#include &lt;math.h&gt;</code><br />
<code>#include &quot;<a class="el" href="embroidery_8h_source.html">../embroidery.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:aaad72d90c58592e330de08139aee5077"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vector_8c.html#aaad72d90c58592e330de08139aee5077">embVector_normalize</a> (<a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> vector, <a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> *result)</td></tr>
<tr class="separator:aaad72d90c58592e330de08139aee5077"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0a4af07bfac410623cf77a35a11550b1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vector_8c.html#a0a4af07bfac410623cf77a35a11550b1">embVector_multiply</a> (<a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> vector, <a class="el" href="embroidery_8h.html#a2082be9aabfb541dff1825c4ca6a05cd">EmbReal</a> magnitude, <a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> *result)</td></tr>
<tr class="separator:a0a4af07bfac410623cf77a35a11550b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a338eacec372464c0c336e26a5586b3e9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vector_8c.html#a338eacec372464c0c336e26a5586b3e9">embVector_add</a> (<a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> a, <a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> b)</td></tr>
<tr class="separator:a338eacec372464c0c336e26a5586b3e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aecc78c302ab283c53ce99697008766d0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vector_8c.html#aecc78c302ab283c53ce99697008766d0">embVector_average</a> (<a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> a, <a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> b)</td></tr>
<tr class="separator:aecc78c302ab283c53ce99697008766d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a55514b10c8ae6869e9889d770f515882"><td class="memItemLeft" align="right" valign="top"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vector_8c.html#a55514b10c8ae6869e9889d770f515882">embVector_subtract</a> (<a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> v1, <a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> v2)</td></tr>
<tr class="separator:a55514b10c8ae6869e9889d770f515882"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5eb0184af5d76ee1369f5019e61c27be"><td class="memItemLeft" align="right" valign="top"><a class="el" href="embroidery_8h.html#a2082be9aabfb541dff1825c4ca6a05cd">EmbReal</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vector_8c.html#a5eb0184af5d76ee1369f5019e61c27be">embVector_dot</a> (<a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> a, <a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> b)</td></tr>
<tr class="separator:a5eb0184af5d76ee1369f5019e61c27be"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac763a1a571c5cb36a99bf73e31ee6919"><td class="memItemLeft" align="right" valign="top"><a class="el" href="embroidery_8h.html#a2082be9aabfb541dff1825c4ca6a05cd">EmbReal</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vector_8c.html#ac763a1a571c5cb36a99bf73e31ee6919">embVector_cross</a> (<a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> a, <a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> b)</td></tr>
<tr class="memdesc:ac763a1a571c5cb36a99bf73e31ee6919"><td class="mdescLeft">&#160;</td><td class="mdescRight">The "cross product" as vectors <em>a</em> and <em>b</em> returned as a real value.  <a href="vector_8c.html#ac763a1a571c5cb36a99bf73e31ee6919">More...</a><br /></td></tr>
<tr class="separator:ac763a1a571c5cb36a99bf73e31ee6919"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acb7c080f09a460062df3d4f9aa2693be"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vector_8c.html#acb7c080f09a460062df3d4f9aa2693be">embVector_transpose_product</a> (<a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> v1, <a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> v2, <a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> *result)</td></tr>
<tr class="separator:acb7c080f09a460062df3d4f9aa2693be"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a96123840be79cee1c9857c7f47e772f2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="embroidery_8h.html#a2082be9aabfb541dff1825c4ca6a05cd">EmbReal</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vector_8c.html#a96123840be79cee1c9857c7f47e772f2">embVector_length</a> (<a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> vector)</td></tr>
<tr class="separator:a96123840be79cee1c9857c7f47e772f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0823dd7ae47773dea4dc396f895fc198"><td class="memItemLeft" align="right" valign="top"><a class="el" href="embroidery_8h.html#a2082be9aabfb541dff1825c4ca6a05cd">EmbReal</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vector_8c.html#a0823dd7ae47773dea4dc396f895fc198">embVector_relativeX</a> (<a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> a1, <a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> a2, <a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> a3)</td></tr>
<tr class="separator:a0823dd7ae47773dea4dc396f895fc198"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8ba74d18e7d36b8340cb9149144d4ea1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="embroidery_8h.html#a2082be9aabfb541dff1825c4ca6a05cd">EmbReal</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vector_8c.html#a8ba74d18e7d36b8340cb9149144d4ea1">embVector_relativeY</a> (<a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> a1, <a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> a2, <a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> a3)</td></tr>
<tr class="separator:a8ba74d18e7d36b8340cb9149144d4ea1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2d40fb11eee627cc40fa0e0b8b0bbcb9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="embroidery_8h.html#a2082be9aabfb541dff1825c4ca6a05cd">EmbReal</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vector_8c.html#a2d40fb11eee627cc40fa0e0b8b0bbcb9">embVector_angle</a> (<a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> v)</td></tr>
<tr class="separator:a2d40fb11eee627cc40fa0e0b8b0bbcb9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a375a523c9d7cba12f3ac30d990868a7a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vector_8c.html#a375a523c9d7cba12f3ac30d990868a7a">embVector_unit</a> (<a class="el" href="embroidery_8h.html#a2082be9aabfb541dff1825c4ca6a05cd">EmbReal</a> alpha)</td></tr>
<tr class="separator:a375a523c9d7cba12f3ac30d990868a7a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abdedf2d469e6f9f4dc6d530086c3aa11"><td class="memItemLeft" align="right" valign="top"><a class="el" href="embroidery_8h.html#a2082be9aabfb541dff1825c4ca6a05cd">EmbReal</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vector_8c.html#abdedf2d469e6f9f4dc6d530086c3aa11">embVector_distance</a> (<a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> a, <a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> b)</td></tr>
<tr class="separator:abdedf2d469e6f9f4dc6d530086c3aa11"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="a338eacec372464c0c336e26a5586b3e9" name="a338eacec372464c0c336e26a5586b3e9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a338eacec372464c0c336e26a5586b3e9">&#9670;&nbsp;</a></span>embVector_add()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> embVector_add </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >The sum of vectors <em>a</em> and <em>b</em> returned as a vector.</p>
<p >Equivalent to:</p>
<p class="formulaDsp">
\[
      \mathbf{c} = \mathbf{a} + \mathbf{b}
                 = \begin{pmatrix} a_{x} + b_{x} \\ a_{y}+b_{y} \end{pmatrix}
\]
</p>
 
</div>
</div>
<a id="a2d40fb11eee627cc40fa0e0b8b0bbcb9" name="a2d40fb11eee627cc40fa0e0b8b0bbcb9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2d40fb11eee627cc40fa0e0b8b0bbcb9">&#9670;&nbsp;</a></span>embVector_angle()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="embroidery_8h.html#a2082be9aabfb541dff1825c4ca6a05cd">EmbReal</a> embVector_angle </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td>
          <td class="paramname"><em>v</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >The angle, measured anti-clockwise from the x-axis, of a vector v. </p>

</div>
</div>
<a id="aecc78c302ab283c53ce99697008766d0" name="aecc78c302ab283c53ce99697008766d0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aecc78c302ab283c53ce99697008766d0">&#9670;&nbsp;</a></span>embVector_average()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> embVector_average </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >The average of vectors <em>v1</em> and <em>v2</em> returned as a vector.</p>
<p >Equivalent to:</p>
<p class="formulaDsp">
\[
      \mathbf{c} = \frac{\mathbf{a} + \mathbf{b}}{2}
                 = \begin{pmatrix} \frac{a_{x} + b_{x}}{2} \\ \frac{a_{y}+b_{y}}{2} \end{pmatrix}
\]
</p>
 
</div>
</div>
<a id="ac763a1a571c5cb36a99bf73e31ee6919" name="ac763a1a571c5cb36a99bf73e31ee6919"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac763a1a571c5cb36a99bf73e31ee6919">&#9670;&nbsp;</a></span>embVector_cross()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="embroidery_8h.html#a2082be9aabfb541dff1825c4ca6a05cd">EmbReal</a> embVector_cross </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The "cross product" as vectors <em>a</em> and <em>b</em> returned as a real value. </p>
<p >Technically, this is the magnitude of the cross product when the embroidery is placed in the z=0 plane (since the cross product is defined for 3-dimensional vectors). That is:</p>
<p class="formulaDsp">
\[
      |c| = \left| \begin{pmatrix} a_x \\ a_y \\ 0 \end{pmatrix} \times \begin{pmatrix} b_x \\ b_y \\ 0 \end{pmatrix}\right|
          = \left| \begin{pmatrix} 0 \\ 0 \\ a_x b_y - a_y b_x \end{pmatrix} \right|
          = a_x b_y - a_y b_x
\]
</p>
 
</div>
</div>
<a id="abdedf2d469e6f9f4dc6d530086c3aa11" name="abdedf2d469e6f9f4dc6d530086c3aa11"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abdedf2d469e6f9f4dc6d530086c3aa11">&#9670;&nbsp;</a></span>embVector_distance()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="embroidery_8h.html#a2082be9aabfb541dff1825c4ca6a05cd">EmbReal</a> embVector_distance </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >The distance between <em>a</em> and <em>b</em> returned as a real value.</p>
<p class="formulaDsp">
\[
     d = \left|\mathbf{a}-\mathbf{b}\right|
       = \sqrt{(a_x-b_x)^{2} + (a_y-b_y)^{2}}
\]
</p>
 
</div>
</div>
<a id="a5eb0184af5d76ee1369f5019e61c27be" name="a5eb0184af5d76ee1369f5019e61c27be"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5eb0184af5d76ee1369f5019e61c27be">&#9670;&nbsp;</a></span>embVector_dot()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="embroidery_8h.html#a2082be9aabfb541dff1825c4ca6a05cd">EmbReal</a> embVector_dot </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >The dot product as vectors <em>v1</em> and <em>v2</em> returned as a EmbReal.</p>
<p >Equivalent to:</p>
<p class="formulaDsp">
\[
      c = \mathbf{a} \cdot \mathbf{b}
        = a_x b_x + a_y b_y
\]
</p>
 
</div>
</div>
<a id="a96123840be79cee1c9857c7f47e772f2" name="a96123840be79cee1c9857c7f47e772f2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a96123840be79cee1c9857c7f47e772f2">&#9670;&nbsp;</a></span>embVector_length()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="embroidery_8h.html#a2082be9aabfb541dff1825c4ca6a05cd">EmbReal</a> embVector_length </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td>
          <td class="paramname"><em>vector</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >The length or absolute value of the vector <em>vector</em>.</p>
<p >Equivalent to:</p>
<p class="formulaDsp">
\[
      |v| = \sqrt{v_{x}^{2} + v_{y}^{2}}
\]
</p>
 
</div>
</div>
<a id="a0a4af07bfac410623cf77a35a11550b1" name="a0a4af07bfac410623cf77a35a11550b1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0a4af07bfac410623cf77a35a11550b1">&#9670;&nbsp;</a></span>embVector_multiply()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void embVector_multiply </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td>
          <td class="paramname"><em>vector</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a2082be9aabfb541dff1825c4ca6a05cd">EmbReal</a>&#160;</td>
          <td class="paramname"><em>magnitude</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> *&#160;</td>
          <td class="paramname"><em>result</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >The scalar multiple <em>magnitude</em> of a vector <em>vector</em>. Returned as <em>result</em>.</p>
<dl class="todo"><dt><b><a class="el" href="todo.html#_todo000240">Todo:</a></b></dt><dd>make result return argument. </dd></dl>

</div>
</div>
<a id="aaad72d90c58592e330de08139aee5077" name="aaad72d90c58592e330de08139aee5077"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaad72d90c58592e330de08139aee5077">&#9670;&nbsp;</a></span>embVector_normalize()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void embVector_normalize </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td>
          <td class="paramname"><em>vector</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> *&#160;</td>
          <td class="paramname"><em>result</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Finds the unit length vector <em>result</em> in the same direction as <em>vector</em>.</p>
<p >Equivalent to:</p>
<p class="formulaDsp">
\[
      \mathbf{u} = \frac{v}{|\mathbf{v}|}
\]
</p>
<dl class="todo"><dt><b><a class="el" href="todo.html#_todo000239">Todo:</a></b></dt><dd>make result return argument. </dd></dl>

</div>
</div>
<a id="a0823dd7ae47773dea4dc396f895fc198" name="a0823dd7ae47773dea4dc396f895fc198"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0823dd7ae47773dea4dc396f895fc198">&#9670;&nbsp;</a></span>embVector_relativeX()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="embroidery_8h.html#a2082be9aabfb541dff1825c4ca6a05cd">EmbReal</a> embVector_relativeX </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td>
          <td class="paramname"><em>a1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td>
          <td class="paramname"><em>a2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td>
          <td class="paramname"><em>a3</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >The x-component of the vector </p>

</div>
</div>
<a id="a8ba74d18e7d36b8340cb9149144d4ea1" name="a8ba74d18e7d36b8340cb9149144d4ea1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8ba74d18e7d36b8340cb9149144d4ea1">&#9670;&nbsp;</a></span>embVector_relativeY()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="embroidery_8h.html#a2082be9aabfb541dff1825c4ca6a05cd">EmbReal</a> embVector_relativeY </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td>
          <td class="paramname"><em>a1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td>
          <td class="paramname"><em>a2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td>
          <td class="paramname"><em>a3</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >The y-component of the vector </p>

</div>
</div>
<a id="a55514b10c8ae6869e9889d770f515882" name="a55514b10c8ae6869e9889d770f515882"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a55514b10c8ae6869e9889d770f515882">&#9670;&nbsp;</a></span>embVector_subtract()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> embVector_subtract </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td>
          <td class="paramname"><em>v1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td>
          <td class="paramname"><em>v2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >The difference between vectors <em>v1</em> and <em>v2</em> returned as <em>result</em>.</p>
<p >Equivalent to:</p>
<p class="formulaDsp">
\[
      \mathbf{c} = \mathbf{a} - \mathbf{b}
                 = \begin{pmatrix} a_{x} - b_{x} \\ a_{y}-b_{y} \end{pmatrix}
\]
</p>
 
</div>
</div>
<a id="acb7c080f09a460062df3d4f9aa2693be" name="acb7c080f09a460062df3d4f9aa2693be"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acb7c080f09a460062df3d4f9aa2693be">&#9670;&nbsp;</a></span>embVector_transpose_product()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void embVector_transpose_product </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td>
          <td class="paramname"><em>v1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a>&#160;</td>
          <td class="paramname"><em>v2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> *&#160;</td>
          <td class="paramname"><em>result</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Since we aren't using full vector algebra here, all vectors are "vertical". so this is like the product v1^{T} I_{2} v2 for our vectors <em>v1</em> and \v2 so a "component-wise product". The result is stored at the pointer <em>result</em>.</p>
<p >That is (1 0) (a) = (xa) (x y)(0 1) (b) (yb) </p>

</div>
</div>
<a id="a375a523c9d7cba12f3ac30d990868a7a" name="a375a523c9d7cba12f3ac30d990868a7a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a375a523c9d7cba12f3ac30d990868a7a">&#9670;&nbsp;</a></span>embVector_unit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="embroidery_8h.html#a16fa26764453571074cb85a7574738d4">EmbVector</a> embVector_unit </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a2082be9aabfb541dff1825c4ca6a05cd">EmbReal</a>&#160;</td>
          <td class="paramname"><em>alpha</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >The unit vector in the direction <em>angle</em>.</p>
<p class="formulaDsp">
\[
      \mathbf{a}_{\alpha} = \begin{pmatrix} \cos(\alpha) \\ \sin(\alpha) \end{pmatrix}
\]
</p>
 
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_dc9e1e299a0b26f222fe6c0a872463f0.html">extern</a></li><li class="navelem"><a class="el" href="dir_6a8aa8af2875e58e82a0145491f7a8e2.html">libembroidery</a></li><li class="navelem"><a class="el" href="dir_50a7dc5dba8160ac8332d90912e622db.html">src</a></li><li class="navelem"><a class="el" href="dir_d5dfb2055b0c9abc7442cd9e132844b4.html">geometry</a></li><li class="navelem"><a class="el" href="vector_8c.html">vector.c</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4 </li>
  </ul>
</div>
</body>
</html>
